# 测试用户注册
Write-Host "测试用户注册..."
$registerBody = '{"username":"testuser","email":"test@example.com","password":"123456"}'
try {
    $response = Invoke-WebRequest -Uri "http://localhost:8080/api/users/register" -Method POST -Body $registerBody -ContentType "application/json"
    Write-Host "注册成功: $($response.Content)"
} catch {
    Write-Host "注册失败: $($_.Exception.Message)"
}

# 测试用户登录
Write-Host "`n测试用户登录..."
$loginBody = '{"email":"test@example.com","password":"123456"}'
try {
    $response = Invoke-WebRequest -Uri "http://localhost:8080/api/users/login" -Method POST -Body $loginBody -ContentType "application/json"
    Write-Host "登录成功: $($response.Content)"
} catch {
    Write-Host "登录失败: $($_.Exception.Message)"
}

# 测试获取视频列表
Write-Host "`n测试获取视频列表..."
try {
    $response = Invoke-WebRequest -Uri "http://localhost:8080/api/videos" -Method GET
    Write-Host "获取视频列表成功: $($response.Content)"
} catch {
    Write-Host "获取视频列表失败: $($_.Exception.Message)"
} 